package com.example.yuntiku.Service;

import com.example.yuntiku.dao.impl.ExamanwerDaoImpl;
import com.example.yuntiku.entity.Examanwer;

import java.util.List;

public class ExamanwerService {
    ExamanwerDaoImpl examanwerDao = new ExamanwerDaoImpl();
    public int insertExamanwerDao(Examanwer examanwer){
        return examanwerDao.insertExamanwerDao(examanwer);
    }
    public int selectCorrect(int testrescordid){
        return examanwerDao.selectCorrect(testrescordid);
    }
    public List<Examanwer> selectBctim(int testrescordid) {
        return examanwerDao.selectBctim(testrescordid);
    }

    /**
     * 添加考试答题记录
     * @param examanwers
     * @return
     */
    public int insertExamanwer(List<Examanwer> examanwers){
        for (Examanwer examanwer : examanwers) {
            examanwerDao.insertExamanwerDao(examanwer);
        }
        return 1;
    }
}
